<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('仓库信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 search-collapse">
			<form id="formId">
				<div class="select-list">
					<ul>
						<li>
							<label for="queryWareName">仓库名称：</label>
							<input type="text" name="queryWareName" id="queryWareName"/>
						</li>
						<li>
							<label for="queryWareProv" >所属省份：</label>
							<select name="queryWareProv" id="queryWareProv" >
								<option value="0" selected>--请选择--</option>
								<option th:each="province,provinceStat:${provinceList}" th:value="${province.provId}" th:text="${province.provName}"></option>
							</select>
						</li>
						<li>
							<label for="queryWareCity" >所属城市：</label>
							<select name="queryWareCity" id="queryWareCity" >
								<option value="0" selected>--请选择--</option>
								<option th:each="city,cityStat:${cityList}" th:value="${city.cityId}" th:text="${city.cityName}">--上饶--</option>
<!--								<option value="2">&#45;&#45;南昌&#45;&#45;</option>-->
							</select>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>

		<!--<div class="btn-group-sm" id="toolbar" role="group">
			<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="storage:ware:add">
				<i class="fa fa-plus"></i> 添加
			</a>
			<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storage:ware:edit">
				<i class="fa fa-edit"></i> 修改
			</a>
			<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="storage:ware:remove">
				<i class="fa fa-remove"></i> 删除
			</a>
			<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storage:ware:export">
				<i class="fa fa-download"></i> 导出
			</a>
		</div>-->
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table"></table>
		</div>
	</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
	var editFlag = [[${@permission.hasPermi('storage:ware:edit')}]];
	var removeFlag = [[${@permission.hasPermi('storage:ware:remove')}]];
	var detailFlag = [[${@permission.hasPermi('storage:warelook:detail')}]];
	var prefix = ctx + "storage/warelook";

	$(function() {
		var options = {
			url: prefix + "/list",
			createUrl: prefix + "/add",
			updateUrl: prefix + "/edit/{id}",
			removeUrl: prefix + "/remove",
			exportUrl: prefix + "/export",
			// viewUrl: prefix + "/detail/{id}",
			detailUrl: prefix + "/detail/{id}",
			modalName: "仓库信息",
			columns: [{
				checkbox: true
			},
				{
					field: 'wareId',
					title: '编号',
					visible: false
				},
				{
					field: 'wareName',
					title: '仓库名称'
				},
				{
					field: 'wareAddress',
					title: '仓库地址'
				},
				{
					field: 'sysCity.cityName',
					title: '仓库区域（市）id'
				},
				{
					field: 'sysChargeUser.userName',
					title: '负责人id'
				},
				{
					field: 'status',
					title: '状态'
				},
				{
					field: 'sysCreateUser.userName',
					title: '创建人id'
				},
				{
					field: 'createTime',
					title: '创建时间'
				},
				{
					title: '操作',
					align: 'center',
					formatter: function(value, row, index) {
						var actions = [];
						// actions.push('<a class="btn btn-success btn-xs ' + viewUrl + '" href="javascript:void(0)" onclick="$.operate.view(\'' + row.wareId + '\')"><i class="fa fa-edit"></i>详细信息</a> ');
						actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.wareId + '\')"><i class="fa fa-search"></i>详细</a>');
						return actions.join('');
					}
				}]
		};
		$.table.init(options);
	});
</script>
<script>
	$(function () {
		$.get("/common/plist",'',function (data) {
			var plist="<option value=\"\">请选择省份</option>";
			$(data).each(function (i,e) {
				plist+="<option value='"+e.provId+"'>"+e.provName+"</option>";
			});
			$("#queryWareProv").html(plist);
		},'json');

		$("#queryWareProv").change(function () {
			var pid=$(this).val();
			$.get("/common/clist?pid="+pid,'',function (data) {
				var clist=" <option value=\"\">请选择城市</option>";
				$(data).each(function (i,e) {
					clist+="<option value='"+e.cityId+"'>"+e.cityName+"</option>";
				});
				$("#queryWareCity").html(clist);
			},"json");
		});
	});
</script>
</body>
</html>